/*
 * @Description:
 * @Version: 2.0
 * @Autor: 许国辉
 * @Date: 2022-12-13 13:00:56
 * @LastEditors: 许国辉
 * @LastEditTime: 2023-05-13 14:36:33
 */
import { defHttp } from '/@/utils/http/axios';
import {
  DepartmentInfoModel,
  DepartmentInfoParams,
  DepartmentInfoResult,
} from './model/DepartmentInfoModel';
enum Api {
  getDepartmentList = '/department/getDepartmentEntityVOs',
  delDepartment = '/department/delDepartmentEntityVO',
  updateDepartment = '/department/saveDepartmentEntityVO',
}

export function getDepartmentListResultModel(params: DepartmentInfoParams) {
  return defHttp.post<DepartmentInfoResult>({
    url: Api.getDepartmentList,
    params,
    headers: {
      ignoreCancelToken: true,
    },
  });
}
export function DelDepartment(value: number) {
  return defHttp.post({
    url: Api.delDepartment,
    params: { id: value },
    headers: {
      ignoreCancelToken: true,
    },
  });
}
export function updateDepartmentListResultModel(params: DepartmentInfoParams) {
  return defHttp.post<DepartmentInfoModel>({
    url: Api.updateDepartment,
    params,
    headers: {
      ignoreCancelToken: true,
    },
  });
}
